<!doctype html>
<html lang="en" ng-app="dataCollectorApp">
<head>
  <meta charset="utf-8">
  <meta name="description" content="StreamSets Data Collector">
  <title ng-bind="common.title">StreamSets Data Collector</title>
  <!--base href="/" /-->
  <link rel="icon" type="image/png" href="assets/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <!-- compiled CSS --><% styles.forEach( function ( file ) { %>
  <link rel="stylesheet" type="text/css" href="/<%= file %>" /><% }); %>

  <!-- compiled JavaScript --><% scripts.forEach( function ( file ) { %>
  <script type="text/javascript" src="/<%= file %>"></script><% }); %>

</head>
<body ng-keydown="common.bodyKeyEvent($event)">

<div class="navbar navbar-default navbar-fixed-top" role="navigation">
  <div class="header-container">
    <div class="navbar-header">
      <a class="logo" href="/">
        <img src="/assets/logo.png" />
      </a>
    </div>
    <div class="collapse navbar-collapse">

      <ul class="nav navbar-nav navbar-right" ng-cloak>
        <li>
          <a href="/">
            <i class="fa fa-home fa-lg"></i>
            <span translate="global.menu.home">Home</span>
          </a>
        </li>

        <li ng-if="common.sdcExecutionMode === pipelineConstant.SLAVE">
          <a ng-href="{{common.sdcClusterManagerURL}}">
            <i class="fa fa-cloud fa-lg"></i>
            <span translate="global.menu.clusterManager">Cluster Manager</span>
          </a>
        </li>

        <li class="dropdown pointer"
            ng-if="common.userName && isAuthorized([userRoles.admin, userRoles.creator, userRoles.manager])">
          <a class="dropdown-toggle" data-toggle="dropdown" href="javascript:;">
            <span>
                <i class="fa fa-cogs fa-lg"></i>
                <span class="hidden-tablet" translate="global.menu.admin.main">
                    Administration
                </span>
                <b class="caret"></b>
            </span>
          </a>
          <ul class="dropdown-menu">
            <li>
              <a href="/collector/configuration">
                <i class="fa fa-gear"></i>
                <span translate="global.menu.admin.configuration">Configuration</span>
              </a>
            </li>

            <li>
              <a href="javascript:;" ng-click="common.showSDCDirectories()">
                <i class="fa fa-folder"></i>
                <span translate="sdcDirectories.title">SDC Directories</span>
              </a>
            </li>

            <li>
              <a href="/collector/jvmMetrics">
                <i class="fa fa-dashboard"></i>
                <span translate="global.menu.admin.jvmMetrics">JVM Metrics</span>
              </a>
            </li>
            <li>
              <a href="/collector/logs">
                <i class="fa fa-tasks"></i>
                <span translate="global.menu.admin.logs">Logs</span>
              </a>
            </li>
            <li ng-if="common.userName && isAuthorized([userRoles.admin]) && common.sdcExecutionMode != pipelineConstant.SLAVE">
              <a href="javascript:;" ng-click="common.shutdownCollector()">
                <i class="fa fa-stop"></i>
                <span translate="global.menu.admin.shutdown">Shutdown</span>
              </a>
            </li>
          </ul>
        </li>

        <li class="dropdown pointer" ng-if="common.authenticationType != 'none'">
          <a class="dropdown-toggle" data-toggle="dropdown" href="javascript:;">
            <span>
                <i class="fa fa-user fa-lg"></i>
                <span class="hidden-tablet">{{common.userName}}</span>
                <b class="caret"></b>
            </span>
          </a>
          <ul class="dropdown-menu">

            <li role="presentation" class="dropdown-header">Assigned Roles</li>

            <li class="disabled">
              <a href="">
                <span>{{common.userRoles}}</span>
              </a>
            </li>

            <li role="presentation" class="divider"></li>

            <li ng-if="common.authenticationType === 'form'">
              <a href="javascript:;" ng-click="common.logout()">
                <span class="glyphicon glyphicon-log-out"></span>
                <span translate="global.menu.account.logout">Logout</span>
              </a>
            </li>
          </ul>
        </li>


        <li class="dropdown pointer">
          <a class="dropdown-toggle" data-toggle="dropdown" href="javascript:;">
            <span>
                <i class="fa fa-question-circle fa-lg"></i>
                <span class="hidden-tablet" translate="global.menu.help.main">
                    Help
                </span>
                <b class="caret"></b>
            </span>
          </a>
          <ul class="dropdown-menu">

            <li>
              <a href="javascript:;" ng-click="common.launchHelpContents()">
                <span class="fa fa-book"></span>
                <span translate="global.menu.help.helpContents">Help Contents</span>
              </a>
            </li>

            <li>
              <a href="javascript:;" ng-click="common.showAbout()">
                <span class="fa fa-info-circle"></span>
                <span translate="global.menu.help.about">About</span>
              </a>
            </li>

            <li role="presentation" class="divider"></li>

            <li>
              <a href="javascript:;" ng-click="common.showSettings()">
                <span class="fa fa-gear"></span>
                <span translate="sdcSettings.title">Settings</span>
              </a>
            </li>

          </ul>
        </li>

      </ul>
    </div>
  </div>
</div>

<ng-include src="'app/help/about/aboutModal.tpl.html'"></ng-include>

<div ng-view ng-if="!notAuthorized">
</div>

<div class="panel panel-default page-panel not-authorized-page"
     ng-class="{'show': true}"
     ng-if="notAuthorized">
  <h4>{{'global.messages.error.notAuthorized' | translate}}</h4>
</div>

</body>
</html>